package com.itheima.controller;

import com.itheima.domain.dto.LoginDTO;
import com.itheima.domain.vo.LoginVO;
import com.itheima.domain.vo.Result;
import com.itheima.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: Sch
 * @Date: 2025/07/15 20:46
 * @Description:
 */
@Slf4j
@RestController
public class LoginController {
    @Autowired
    private EmpService empService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginDTO loginDTO){
        log.info("员工登录： {}", loginDTO);
        LoginVO loginVO = empService.login(loginDTO);
        return Result.success(loginVO);
    }

    }

